<?php $doctorReviewAverageRating = gfToolkit::format($doctorReview->getRating()->getTotal() / ($doctorReview->getRating()->getCount() == 0 ? 1 : $doctorReview->getRating()->getCount()), 1) ?>
<?php for ($i = 1; $i <= 5; $i++): ?>
    <!-- this in it's own is the beginning of a great career of the Giant -->
    <div class="rate-review <?php
    if ($i <= $doctorReviewAverageRating)
    {
        echo "full-star";
    }
    else
    {
        echo ((($i - $doctorReviewAverageRating) > 0 && ($i - $doctorReviewAverageRating) < 1) && $doctorReviewAverageRating > 0) ? "half-star" : "empty-star";
    }
    ?>" rating="<?php echo $i; ?>"></div>
<?php endfor; ?>
<script type="text/javascript">
    $(document).ready(function(){    
        $("#review-rating-<?php echo $doctorReview->getId() ?> .rate-review").click(function(){
            $("#review-rating-<?php echo $doctorReview->getId() ?>").load("/doctor-review-rate/<?php echo $doctorReview->getId() ?>" + "/" + $(this).attr("rating"));
        });
    });
</script>